home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / i / internet / software / lprsr / spoo.s < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.2 KB  |  102 lines

  1. **********************************************************************
  2. *       program netspl.s         residenter modul zur umlenkung      *
  3. *       pm 10/92                 des gemdostraps 1. implementiert    *
  4. *       (pure-c)                 druck-dämon für *.pco-files.        *
  5. **********************************************************************
  6.  
  7.         export    path
  8.         export    flag
  9.         export    oldgem
  10.         export    grpgem
  11.         export  fhandle
  12.         
  13.         .text
  14.  
  15. *-------------------------------*
  16. *    residenter programmteil    *
  17. *-------------------------------*
  18.         dc.b "XBRANSPO"
  19.  
  20. oldgem: dc.l    0
  21.        
  22. grpgem: tst.w    flag
  23.         bne    dogem
  24.  
  25.         move    (a7),d0          * test user/super mode
  26.         btst    #13,d0
  27.         bne.b   sup
  28.         move.l  usp,a0
  29.         bra.b   tst
  30.  
  31. sup:    lea     6(a7),a0
  32. tst:    cmp.w   #$3c,(a0)      * is it Fcreate
  33.         beq.b   openfile
  34.         cmp.w   #$3d,(a0)      * or Fopen
  35.         bne     tryclose
  36.         
  37. openfile:
  38.         move.l  2(a0),a0        * test filename
  39.  
  40.         move.l  a0,a1              
  41. lp1:    tst.b  (a1)+
  42.         bne.b   lp1
  43.         
  44.         cmp.b   #'.',-5(a1)
  45.         bne     dogem
  46.         cmp.b   #'P',-4(a1)
  47.         bne     dogem
  48.         cmp.b   #'C',-3(a1)
  49.         bne     dogem
  50.         cmp.b   #'O',-2(a1)
  51.         bne     dogem
  52.         
  53.         lea.l   path,a1
  54. lp2:    move.b  (a0)+,(a1)+
  55.         bne.b   lp2
  56.  
  57.         move.l  2(a7),retadr1
  58.         move.l  #myret1,2(a7)
  59.         move.l  oldgem,-(a7)
  60.         rts
  61.         
  62. myret1:
  63.         cmp.w    #6,d0
  64.         bmi.s    skip
  65.         move.w  d0,fhandle
  66. skip:
  67.         move.l  retadr1,-(a7)
  68.         rts
  69.  
  70. tryclose:
  71.         cmp.w     #$3e,(a0)        * Fclose
  72.         bne     dogem            * compare with saved handle
  73.  
  74.         move.w  2(a0),d0
  75.         cmp.w    fhandle,d0
  76.         bne        dogem
  77.         
  78.         cmp.w    #6,fhandle
  79.         bmi        dogem
  80.         move.l  2(a7),retadr
  81.         move.l  #myret2,2(a7)
  82.         bra.s    dogem
  83. myret2:
  84.         addq.w    #1,flag
  85.         move.w    #-100,fhandle
  86.         move.l  retadr,-(a7)
  87.         rts
  88.  
  89. dogem:  move.l  oldgem,-(a7)
  90.         rts
  91.  
  92.         .data
  93.  
  94. retadr:        dc.l    0
  95. retadr1:    dc.l    0
  96. flag:        dc.w    0
  97. fhandle:    dc.w    0
  98. path:        ds.b    128
  99.  
  100.         end
  101.  
  102.